export function debounce(fn: (...args: any[]) => any,wait: number){
    var timer:any = null;
    return function(...t: any){
        if(timer !== null){
            clearTimeout(timer);
        }
        timer = setTimeout(() => {
            fn(...t)
        },wait);
    }
}